package com.dingwen.treasure.business.controller;

import com.dingwen.treasure.base.controller.BaseViewController;
import com.dingwen.treasure.base.util.AreaUtil;
import com.dingwen.treasure.base.pojo.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * 　AreaUtilController
 * 　@author dingwen
 * 　@date 2022/8/28
 */
@Api(tags = "行政区划工具类API")
@RestController
@Slf4j
@RequestMapping("area")
public class AreaUtilController implements BaseViewController {

    @ApiOperation(value = "测试")
    @GetMapping
    public Result<List<String>> test() {
        List<String> areas = new ArrayList<>(3);
        areas.add(AreaUtil.getProvinceAreaCode("330424102204"));
        areas.add(AreaUtil.getCityAreaCode("330424102204"));
        areas.add(AreaUtil.getCountyAreaCode("330424102204"));
        return success(areas);
    }
}
